package properties.xml.log.properties;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/**
 * 目标：掌握把键值对数据存入到属性文件中去
 */
public class PropertiesTest2 {
    public static void main(String[] args) throws Exception {
        // 1、创建Properties对象出来，先用它存储一些键值对数据
        Properties properties = new Properties();
        properties.setProperty("kk", "minmin");
        properties.setProperty("ll", "cuishan");
        properties.setProperty("yy", "susu");
        
        // 2、把properties对象中的键值对数据存入到属性文件中去
        properties.store(new FileWriter("D:\\code\\java-demo1\\src\\properties\\xml\\log\\properties\\user2.properties"), "i save many user!");
    }
}
